package net.villonanny.type;

import java.util.EnumMap;

/**
 * A map of Integers with TroopType as key.
 * For each type of troop, holds the amount.
 */
public class TroopTypeMap extends EnumMap<TroopType, Integer> {

	public TroopTypeMap() {
		super(TroopType.class);
		init();
	}

	public TroopTypeMap(TroopTypeMap m) {
		super(m);
		init();
	}
	
	private void init() {
		// Initialise with zero to avoid nullpointers when auto(un)boxing from Integer
		for (TroopType type : TroopType.values()) {
			put(type, 0);
		}
	}
	
//	/**
//	 * @return the sum of all values, which is the total resources contained in this map
//	 */
//	public int getSumOfValues() {
//		int tot = 0;
//		for (int val : values()) {
//			tot += val;
//		}
//		return tot;
//	}


//	@Override
//	public String toString() {
////		StringBuffer result ? n
////		return String.format("[%s|%s|%s|%s", );
//		return "TODO"; // TODO
//	}
	
	
	
	
}
